
#ifndef _CARD_PARAM_H_
#define _CARD_PARAM_H_
#include <stdint.h>

#define is_TA_present(TD) (TD & 0x10)
#define is_TB_present(TD) (TD & 0x20)
#define is_TC_present(TD) (TD & 0x40)
#define is_TD_present(TD) (TD & 0x80)


enum _character{C_TA, C_TB, C_TC, C_TD};


typedef struct _card_param_block
{
	uint8_t present_map;
	uint8_t data[4];
}card_param_block_t;

typedef struct _card_param
{
	uint8_t block_amout;
	card_param_block_t param[8];
}card_param_t;

void card_param_clear(card_param_t *param);
uint32_t card_param_init(card_param_t *param, uint8_t atr[]);
uint32_t card_param_get_specific_char(card_param_t *param, uint8_t character, uint8_t index);
uint32_t card_param_block_get_specific_char(card_param_block_t *param_block, uint8_t character);


#endif

